<!DOCTYPE html>
<html lang="en" dir="ltr">
  <head>
    <meta charset="UTF-8" />
    <title>Floating Action Button - Standalone</title>
    <meta
      name="viewport"
      content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"
    />
    <link href="../../../../../css/core.css" rel="stylesheet" />
    <link href="../../../../../scripts/testing/styles.css" rel="stylesheet" />
    <script src="../../../../../scripts/testing/scripts.js"></script>
    <script nomodule src="../../../../../dist/ionic/ionic.js"></script>
    <script type="module" src="../../../../../dist/ionic/ionic.esm.js"></script>
  </head>

  <body>
    <ion-fab-button href="https://ionicframework.com">
      <ion-icon name="logo-ionitron"></ion-icon>
    </ion-fab-button>
    <ion-fab-button href="https://ionicframework.com" target="_blank">
      <ion-icon name="logo-ionitron"></ion-icon>
    </ion-fab-button>

    <ion-button href="https://ionicframework.com" target="_blank">
      <ion-icon name="logo-ionitron"></ion-icon>
    </ion-button>

    <script>
      function insertAfter(el, referenceNode) {
        referenceNode.parentNode.insertBefore(el, referenceNode.nextSibling);
      }

      function add() {
        var newEle = document.createElement('f');
        var ref = document.querySelector('f');
        insertAfter(newEle, ref);
        console.log('add');
      }

      function clickMainFAB(container) {
        let message = 'Clicked open social menu';
        console.log(message);

        openLists(container);
      }

      function openSocial(network, container) {
        let message = 'Share in ' + network;
        console.log(message);

        openLists(container);
      }

      function openLists(container) {
        var fabLists = document.getElementById(container).querySelectorAll('ion-fab-list');

        for (var i = 0; i < fabLists.length; i++) {
          fabLists[i].activated = true;
        }
      }
    </script>

    <style>
      f {
        display: block;
        margin: 15px auto;
        max-width: 150px;
        height: 150px;
        background: blue;
      }

      f:last-of-type {
        background: yellow;
      }
    </style>
  </body>
</html>
